
commonlib.__ui_directory__ = commonlib.FormatPath(commonlib.__script_directory__ .. "/ui");
commonlib.__ui_filename__ = commonlib.FormatPath(commonlib.__ui_directory__ .. "/init.lua");

local Window = commonlib.import("../window/Window.lua", commonlib.__ui_filename__);

function commonlib.Tip(text, duration, color)
    local wnd = Window:new():Init({
        G = {
            text = text,
            duration = duration,
            color = color,
        }, 
        url = "@package/main/ui/Tip.html",
        width = 800,
        height = 60,
        x = 0,
        y = 100,
        alignment = "_ctt",
        zorder = 1000,
    });
    
    wnd:Show();

    return wnd;
end
